package touchtrack.controller;

import touchtrack.exception.IllegalDuplicationException;
import touchtrack.model.World;
import touchtrack.model.artist.Artist;

/**
 * ArtistController
 * 
 * @author	MuMe09 team 6
 * 			http://mumetech.wordpress.com/
 */
public class ArtistController
{
	/**
	 * Constructor.
	 * 
	 * @param 	world
	 */
	public ArtistController(World world)
	{
		this.world = world;
	}

	/***************************************************************************
	 * 								Creation
	 ***************************************************************************/
	
	/**
	 * Creates an artist & adds it to the database.
	 * 
	 * @param 	artist
	 */
	public void createArtist(String artist) 
		throws IllegalDuplicationException
	{
		Artist a = new Artist(artist);
		try
		{
			this.world.getArtistDatabase().add(a);
		}
		catch (IllegalDuplicationException e)
		{
			// just ignore it
		}
	}

	/***************************************************************************
	 * 							World reference
	 ***************************************************************************/
	
	private World world;
}